package com.atguigu.tingshu.payment;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.payment.PaymentInfo;
import com.atguigu.tingshu.payment.impl.PaymentDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * <p>
 * 支付模块远程调用API接口
 * </p>
 *
 * @author atguigu
 */
@FeignClient(value = "service-payment", path = "api/payment", fallback = PaymentDegradeFeignClient.class)
public interface PaymentFeignClient {

    /**
     * 通过支付类型(订单or充值)和订单流水号获取本地交易记录 供订单服务中关闭第三方支付平台(微信支付)支付订单使用
     * @param paymentType
     * @param orderNo
     * @return
     */
    @PostMapping("/savePaymentInfo/{paymentType}/{orderNo}")
    public Result<PaymentInfo> getOutOrderNo(@PathVariable("paymentType") String paymentType,
                                             @PathVariable("orderNo") String orderNo);
}
